<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of
 *
 * @author Schorr
 */
class Fkb_Validate_EventFrequenceNeeded extends Zend_Validate_Identical {
    

    const DATE_INVALID = 'dateInvalid';
    
    protected $_messageTemplates = array(
	self::MISSING_TOKEN=> "Bei Serienterminen muss das Ende der Serie angegeben werden. "
    );
        public function isValid($value, $context = null) {	

	$this->_setValue((string) $value);
	if($value=='ONCE')
	    return true;
	
        if (($context !== null) && isset($context) && array_key_exists($this->getToken(), $context)) {
            $token = $context[$this->getToken()];
        } else {
            $token = $this->getToken();
        }
	if ($token == null || $token== "") {
            $this->_error(self::MISSING_TOKEN);
            return false;
        }
	return true;
	
    }
    
}

?>
